diff options
| author | Adam Soltys <[email protected]> | 2024-09-10 20:39:47 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-09-17 09:18:36 -0700 |
| commit | 1f63848ca9fb01336f04b41434de1cc06a5b3d93 (patch) | |
| tree | 2affa3041863be365f33d99e1f32bda60cf93a32 /src/routes/(app)/verify/[code] | |
| parent | 6e48c584605bec5623c12c470d04d07303983801 (diff) | |
| download | coinos-ui-1f63848ca9fb01336f04b41434de1cc06a5b3d93.tar.gz coinos-ui-1f63848ca9fb01336f04b41434de1cc06a5b3d93.zip | |
move routes
Diffstat (limited to 'src/routes/(app)/verify/[code]')
| -rw-r--r-- | src/routes/(app)/verify/[code]/+page.server.ts | 14 | ||||
| -rw-r--r-- | src/routes/(app)/verify/[code]/+page.svelte | 35 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/routes/(app)/verify/[code]/+page.server.ts b/src/routes/(app)/verify/[code]/+page.server.ts new file mode 100644 index 00000000..66ef39ad --- /dev/null +++ b/src/routes/(app)/verify/[code]/+page.server.ts @@ -0,0 +1,14 @@ +import { get } from "$lib/utils"; +import { redirect } from "@sveltejs/kit"; + +export let load = async ({ params: { code } }) => { + let user; + try { + user = await get(`/verify/${code}`); + } catch (e) { + console.log(e); + return { error: "Verification failed" }; + } + + redirect(307, `/settings/account?verified=true`); +}; diff --git a/src/routes/(app)/verify/[code]/+page.svelte b/src/routes/(app)/verify/[code]/+page.svelte new file mode 100644 index 00000000..1e099dae --- /dev/null +++ b/src/routes/(app)/verify/[code]/+page.svelte @@ -0,0 +1,35 @@ +<script> + import { scale } from "svelte/transition"; + import Icon from "$comp/Icon.svelte"; + import { t } from "$lib/translations"; + + export let data; + let { user, error } = data; +</script> + +<div class="container px-4 text-center mx-auto"> + {#if error} + <h1 class="text-3xl md:text-4xl font-bold mb-6"> + Email verification failed + </h1> + {:else if user.verified} + <div + class="flex w-full py-5 max-w-[200px] mx-auto" + in:scale={{ start: 0.5 }} + > + <Icon icon="check" style="mx-auto" /> + </div> + + <h1 class="text-3xl md:text-4xl font-bold mb-6"> + Email verified successfully! + </h1> + {/if} +</div> + +<a href={`/${user.username}`}> + <div class="opacity-0 w-screen h-screen fixed top-0 left-0 z-50" /> +</a> + +<div class="fixed bottom-10 w-full text-center"> + {$t("payments.tapAnywhere")} +</div> |
